// 请求
import { get_getViewDataTree } from '@/server/view'
// 工具
import { dataNotChildren } from '@/util/utils'
const state = {
    findByTypeList: [],
    findByTypeNotChildren: []
}

const actions = {
    async findByType({commit}) {
        // 获取业务数据图层树
        let workData = await get_getViewDataTree()
        let workList = workData.data.tree
        commit('setFindByType', workList)
    }
}

const mutations = {
    setFindByType(state, workList) {
        state.findByTypeList = workList
        state.findByTypeNotChildren = dataNotChildren(workList)
    }
}

export default {
    namespaced: true,
    state,
    actions,
    mutations
}
